<template>
    <div class="appLoading" v-if="showNum" :style="{height:showNum?'3px':'3px'}">
        <div class="projectLoading">
            <div :class="`h100 text-center ${showNum?'loading':'loadingEnd'}`">
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "Loading",
        data() {
            return {
                showNum: 0
            }
        }
    }
</script>

<style scoped lang="scss">
    .loading {
        height: 2px;
        animation: loadingFn forwards 3s;
    }

    .loadingEnd {
        height: 2px;
        animation: loadingEnd forwards 500ms;
        background-color: #00adf8;
    }

    .appLoading {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999999;
    }

    .projectLoading {
        background-color: #eee;
    }

    @keyframes loadingFn {
        0% {
            background-color: #fff;
            width: 0;
        }
        25% {
            width: 85%;
            background-color: #00adf8;
        }
        100% {
            width: 95%;
            background-color: #00adf8;
        }
    }

    @keyframes loadingEnd {
        0% {
            height: 2px;
            width: 95%;
        }
        100% {
            height: 0;
            width: 100%;
        }
    }
</style>
